import { createApp } from 'vue'
import App from './App.vue'

import router from './router.js'	// 导入路由模块
// import axios from 'axios';
// import request from "./axios/request.js";
// import flexible from './flexible.js';

const app = createApp(App);
// app.use(axios)
// app.use(request)
app.use(router)
app.mount('#app')

// import { router } from '../../router.js'; // 假设你已经有一个router实例
import { useRouter } from 'vue-router'
import { onMounted } from 'vue';
router.afterEach((to, from) => {
  if (from.path !== to.path&&from.path!='/') {
    console.log(from.path)
    console.log(to.path)
    // const router = useRouter();
    //         router.go(0);
    window.location.reload();
    router.push(to.path)
    from.path=to.path
    console.log(from.path)
    console.log(to.path)
  }
//   next();
}); 